//
//  HWNews.m
//  ParagraphString
//
//  Created by Lucy_Lee on 2017/1/19.
//  Copyright © 2017年 Lucy_Lee. All rights reserved.
//

#import "HWNews.h"
#import "HWParagraphString.h"
#import "HWBaseParagraphStyle.h"
#import "UIView+HWExt.h"

@interface HWNews ()

@property (nonatomic, strong, readwrite) NSMutableAttributedString * attributedContent;

@property (nonatomic, readwrite) CGFloat contentHeight;

@end

@implementation HWNews

+ (instancetype)newsWithTitle:(NSString *)title content:(NSString *)content{
    
    HWNews * news = [[[self class] alloc]init];
    news.title = title;
    news.content = content;
    
    HWParagraphString * string = [HWParagraphString paragraphStringWithString:news.content font:[UIFont systemFontOfSize:12.0] color:[UIColor blackColor] paragraphStyle:[HWBaseParagraphStyle new]];
    news.attributedContent  = string.attributedString;
    news.contentHeight      = 50.f + [string heightWithFixedWidth:Width - 30.f] + 15.f;
    
    return news;
}


@end
